有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!


共 (1) 个答案

  1. # 1 楼答案

    Wildfly的Web (Undertow) Reference Guide报告(最近一次更新于2014年7月)指出:

    Sharing sessions between wars in an ear

    Undertow allows you to share sessions between wars in an ear, if it is explicitly configured to do so. Note that if you use this feature your applications may not be portable, as this is not a standard servlet feature.

    In order to enable this you must include a shared-session-config element in the jboss-all.xml file in the META-INF directory of the ear:

    <jboss umlns="urn:jboss:1.0">
        <shared-session-config xmlns="urn:jboss:shared-session-config:1.0">
            <session-config>
                <cookie-config>
                    <path>/</path>
                </cookie-config>
            </session-config>
        </shared-session-config>
    </jboss>
    

    This element is used to configure the shared session manager that will be used by all wars in the ear. For full details of all the options provided by this file please see the schema at https://github.com/wildfly/wildfly/blob/master/undertow/src/main/resources/schema/shared-session-config_1_0.xsd, however in general it mimics the options that are available in jboss-web.xml for configuring the session.

    这是在WFLY-1891(修复版本:8.2.0.Final,9.0.0.Alpha1)中添加的,注释note指出它在集群中不起作用(截至2014年4月)

    另见另一个SO post-Session sharing on WildFly is not working

    编辑:

    WFLY-3270 - Clustered support for HTTPSession sharing between wars delivered in an EAR注意到9.0.0解决了集群问题。字母1